home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / sys / amiga / programmer / 25 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  3.5 KB

  1. Path: informatik.tu-muenchen.de!fischerj
  2. From: fischerj@Informatik.TU-Muenchen.DE (Juergen "Rally" Fischer)
  3. Newsgroups: comp.sys.amiga.programmer
  4. Subject: Re: PPC compilers
  5. Date: 1 Jan 1996 21:01:09 GMT
  6. Organization: Technische Universitaet Muenchen, Germany
  7. Distribution: world
  8. Message-ID: <4c9i2l$h3i@sunsystem5.informatik.tu-muenchen.de>
  9. References: <john.hendrikx.40ka@grafix.xs4all.nl> <4b77tq$htp@serpens.rhein.de> <MQAQx*XOe@yaps.rhein.de> <4bqhnf$6g5@sunsystem5.informatik.tu-muenchen.de> <jasonb.820051107@cs.uwa.edu.au>
  10. NNTP-Posting-Host: hphalle5.informatik.tu-muenchen.de
  11. X-Newsreader: TIN [version 1.2 PL2]
  12.  
  13. Jason S Birch (jasonb@cs.uwa.edu.au) wrote:
  14. : fischerj@Informatik.TU-Muenchen.DE (Juergen "Rally" Fischer) writes:
  15.  
  16. : >Arno Eigenwillig (arno@yaps.rhein.de) wrote:
  17. : >: In article <4bd6ti$rad@sunsystem5.informatik.tu-muenchen.de>, Juergen "Rally" Fischer writes:
  18. : >: > C is more complex, for example you can't tell me the word-width of
  19. : >: > "*a++=*b;"
  20.  
  21. : But you can't say whether move.w (a0)+,(a1)+ is what you want without
  22. : knowing what a0 and a1 are pointing to any more than you can with C.
  23.  
  24. yes, but in the C example you even don't know if it's .w, TAIC.
  25.  
  26. : [...]
  27.  
  28. : >: > and you even can't tell me how much is postadded to a.
  29. : >: Of course you can - 1 will be added. Before you try to say anything
  30. : >: about word widths in reply, find out about C pointer math.
  31.  
  32. : >int *a(int *p)
  33. : >{
  34. : >   p++; return p;
  35. : >}
  36.  
  37. : [...]
  38.  
  39. : >_a:
  40. : >        movel sp@(4),d0
  41. : >        addql #4,d0
  42.  
  43. : >so how comes that your "1" turns a #4 in asm ? oops ;)
  44.  
  45. : You should have followed his advice. :-) What he's saying is that "1"
  46. : of whatever the variable size is will be added to a, which is one of
  47. : the main points of a higher level language (although C isn't much more
  48. : than a macro assembler on steroids...).  True, you don't know exactly
  49. : how many bytes will be added to the pointer without checking the type
  50. : of the pointer first, while in assembler you know exactly how many
  51. : bytes will be added - but, OTOH, the fact that the compiler takes care
  52. : of adding the right number of bytes all the time removes yet another
  53. : avenue for error - with assembler, you have to repeatedly *tell* it how
  54. : many, and if just one of those is wrong...
  55.  
  56. Yes, I never claimed the opposite :) I did make a claim about a very special
  57. example. 
  58.  
  59. : >indeed true, for example the "clr.w = read-write on 68000" thing.
  60. : >the fact that asm isn't 100.0% clear does not change the fact that
  61. : >the C version (see example) is less clear.
  62. : >no faulty logic.
  63.  
  64. : The C version is only less clear in that the one line of code you're
  65. : looking at doesn't tell you exactly what the computer will do. It's
  66.  
  67. YOU GOT IT! TAIC! THAT'S IT! I didn't make different claims.
  68. And when you think this is the buggy line you focus it, and the
  69. asm line gives more info, and in this _special_ case asm is imho
  70. easeier debugging.
  71.  
  72. : >   fischerj@Informatik.TU-Muenchen.DE (Juergen "Rally" Fischer)   =:)
  73.  
  74. : -- 
  75. : Jason S Birch                        ,-_|\ email: jasonb@cs.uwa.edu.au
  76. : Department of Computer Science      /     \ Tel (work): +61 9 380 1840
  77. : The University of Western Australia *_.-._/ Fax (work): +61 9 380 1089
  78. : Nedlands  W. Australia  6907             v  Tel (home): +61 9 386 8630
  79.  
  80. -----------------------------------------------------------------------------
  81.        //  fischerj@Informatik.TU-Muenchen.DE (Juergen "Rally" Fischer)
  82.       //   
  83.     \X/    My wishes for '96:
  84.            may the AT promises come true. Amiga's back.
  85. -----------------------------------------------------------------------------
  86.